<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {

            display: flex;
            /* 水平居中 */
            justify-content: center;
            /* 垂直居中 */
            align-items: center;

            /* 文本水平居中 */
            text-align: center;
            /* 文本垂直居中 */
            height: 80px;
            line-height: 80px;

            /* 定位 */
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);

            /* 垂直居中，一般适用于行内盒 */
            vertical-align: middle;

            /* 元素水平居中 */
            margin: auto;
        }
    </style>
</head>

<body>

    <script>


        let arr = [1, 2, 3, 4, 5, 6];
        let arr1 = arr.slice(2);
        console.log(arr1);//[3, 4, 5, 6]
        let arr2 = arr.slice(2, 5);
        console.log(arr2);//[3,4,5]

        let obj = {
            name: 'mike',
            gender: '男'
        }



        let { name, gender, age = 18 } = obj;
        // let { name, gender, age:aAge = 18 } = obj;

        console.log(name, gender, aAge);//mike 36 男

        // let arr3 = ['abc', 'def',999]
        // let [a, b, c=100] = arr3;
        // console.log(a, b, c);

    </script>

</body>

</html>